package com.abl.core.mybatis.mapper;

import com.abl.core.domain.db.SysUser;
import com.mybatisflex.core.BaseMapper;
import com.mybatisflex.core.query.QueryWrapper;

import static com.abl.core.domain.db.table.SysUserTableDef.SYS_USER;

public interface SysUserMapper extends BaseMapper<SysUser> {

    default SysUser getOneByCode(String code) {
        QueryWrapper query = QueryWrapper.create()
                .and(SYS_USER.MT_CODE.eq(code));
        return selectOneByQuery(query);
    }

    default SysUser getColumn(String userId, String... column) {
        QueryWrapper query = QueryWrapper.create()
                .select(column)
                .and(SYS_USER.ID.eq(userId));
        return selectOneByQuery(query);
    }

}